#define _CRT_SECURE_NO_WARNINGS 1
bool hasCycle(struct ListNode* head) {
    if (head == NULL)
    {
        return false;
    }
    struct ListNode* slow = head;
    struct ListNode* fast = head->next;
    while (slow != NULL && fast != NULL && fast->next != NULL)
    {
        if (slow == fast)
        {
            return true;
        }
        else
        {
            slow = slow->next;
            fast = fast->next->next;
        }
    }
    return false;
}
